﻿using System;
using System.Collections.Generic;

using System.Text;
using Microsoft.Xna.Framework.Content;

namespace RebellionII.GameObjects.Other
{
    public enum AttributeUsed
    {
        Combat,
        Leadership,
        Espionage,
        Diplomacy,
        Research
    };

    [Flags]
    public enum TargetTeam
    {
        Own,
        Neutral,
        Enemy
    };

    [Flags]
    public enum TargetAction
    {
        Destroy,
        Recruit,
        Recon,
        JediTraining,
        Assasinate,
        Abduction,
        Espionage,
        Diplomacy,
        InciteUprising,
        Research,
        Rescue,
        SubdueUprising
    };

    [Flags]
    public enum TargetType
    {
        Unit,
        System,
        Character
    };

    public class Mission
    {
        [ContentSerializerIgnore]
        public int iUniqueID { get; set; }

        public TeamName TheTeam { get; set; }
        TargetTeam eTeamTarget { get; set; }
        TargetAction eAction { get; set; }
        TargetType eTargetType { get; set; }

        bool bKeyCharacterMission{ get; set; }
        bool bJediMission { get; set; }

        AttributeUsed eAttribute { get; set; }
        int iSuccessChance{ get; set; }
        int iTickCount{ get; set; }

        [ContentSerializerIgnore]
        Random rollaRandom = new Random();

        public Mission()
        {

        }

        public bool PerformSuccessCalculation()
        {
            int temp = rollaRandom.Next(100);
            double temp2 = 0.03*(iSuccessChance - 10)/*change to number of attributes thingo*/;
            double temp3 = 0.95 / Math.Pow(Math.E, temp2);
            
            if(temp > temp3)
                return false;
            else
                return true;

        }



    }
}
